//
//  TableEnum.swift
//  CooperSwift_Example
//
//  Created by 计海峰 on 2021/5/27.
//  Copyright © 2021 CocoaPods. All rights reserved.
//

import Foundation


public enum TableViewModelFromTargetServiceEnum {
    case table, controller, view, all, reloadTable, endEdit
}

public enum TableViewModelRunServiceEnum {
    case reloadTable, reloadSection, reloadCell, removeSection, removeCell, toTableCellTop, toTableCellBottom, updatesTable, updatesCellHeight
    case hiddenKeyboard /// , reloadData, reForRows
}

public extension TableViewModelRunServiceEnum {
    func runMethod() -> String {
        var method = ""
        switch self {
        case .reloadTable:
            method = "serviceReloadTable"
        case .reloadSection:
            method = "serviceReloadTableSection"
        case .reloadCell:
            method = "serviceReloadTableCell"
        case .removeCell:
            method = "serviceRemoveTableCell"
        case .removeSection:
            method = "serviceRemoveTableSection"
        case .toTableCellTop:
            method = "toTableCellTop"
        case .toTableCellBottom:
            method = "toTableCellBottom"
        case .updatesTable:
            method = "serviceUpdatesTable"
        case .updatesCellHeight:
            method = "serviceUpdatesRowHeight"
        case .hiddenKeyboard:
            method = "serviceHiddenKeyboard"
//        case .reloadData:
//            method = "serviceReloadData"
//        case .reForRows:
//            method = "serviceReForRows"
        }
        return method
    }
}
